﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
    <head>
        <meta content="Innovasys Document! X (http://www.innovasys.com)" name=GENERATOR>
        <!--DXMETADATA start type="MetaCharset" --><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><!--DXMETADATA end-->
        <!--DXMETADATA start type="PageItemTitle" format="<title>Overview</title>" --><title>StateOptions Object</title><!--DXMETADATA end-->
        <link href="stylesheets/axstylesheet.css" type=text/css rel=stylesheet>
        <script src="script/ax.js" type=text/javascript>
    </script>

    


<style>
html,div { margin: 0; padding: 0;}

body {
	padding: 0px;
	margin: 0px;
	overflow: auto;
	height: 100%;
}

#winchm_template_button{
	float: right;
	width: 93px;
	top: 7px;
	position: relative;
	text-align: right;
	right: 5px;
	height: auto;
}

#winchm_template_top{
	padding: 0px;
	margin: 0px;
	border-bottom: 1px solid #9B9B9B;
	background-color: #B1CEFE;
}

#winchm_template_navigation{
	margin: 0px;
	padding-top: 7px;
	padding-left: 7px;
	padding-bottom: 3px;
	padding-right: 0px;
	font-size: 8.5pt;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	color: #585858;
}

#winchm_template_title{
	margin: 0px;
	padding-top: 4px;
	padding-left: 7px;
	padding-bottom: 7px;
	padding-right: 0px;
	font-size: 18px; 
	font-family: Verdana, Geneva, sans-serif;
	color: #363636;
}

#winchm_template_content{
	margin-top: 20px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	width: auto  !important;
	width: 100%;
}

#winchm_template_footer{
	border-width: 1px;
	border-color: #B1CEFE;
	border-top-style: solid;
	margin-top: 15px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	padding-top: 7px;
	padding-left: 0px;
	padding-bottom: 0px;
	padding-right: 0px;
	font-family: arial, helvetica, sans-serif;
	font-size: 8.5pt;
	color: #696969;
	width: auto;
	text-align: left;
}


#winchm_template_container{
	margin: 0px;
	padding: 0px;
	position: static;
	padding-bottom: 3px;
	overflow: auto;
	background-color: #FFFFFF;
}


@media print
{
#winchm_template_container{
	position: static;	
	margin: 0px;
	padding: 5px;
	
	width: auto;
	height: auto;
	overflow: auto;
}
#winchm_template_button{
visibility:hidden;
}
}

#winchm_template_navigation A:link	{text-decoration: none; color:#004080}
#winchm_template_navigation A:visited  {text-decoration: none; color: #004080}
#winchm_template_navigation A:active {text-decoration: none; color: #004080 }
#winchm_template_navigation A:hover {text-decoration: none;color: #0080FF}

A:link	{text-decoration: underline; color:#0033CC}
A:visited  {text-decoration: underline; color: #0033CC}
A:active {text-decoration: underline; color: #0033CC }
A:hover {text-decoration: underline;color: #FF0000;}
</style>
<script type="text/javascript">
function isMobile(){
Agent = window.navigator.userAgent;
if (Agent.indexOf("iPhone")>=1 || Agent.indexOf("iPad")>=1 || Agent.indexOf("iPod")>=1 || Agent.indexOf("Android")>=1){
return true;
}else{
return false;	
}

}
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_container').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_container').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_container').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_container').style.width = 'auto';
document.getElementById('winchm_template_container').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

if(!isMobile()){

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;

document.write("<style>\n");
document.write("body {overflow: hidden;}\n");
document.write("#winchm_template_container {position: absolute;overflow: auto;top : 0px;right: 0px;bottom: 0px;left: 0px;}\n");
document.write("</style>\n");
}

</script>
</head>
    <body><script language="JavaScript" type="text/JavaScript">
function syn(){
if(parent.nav.tree){
 if(parent.nav.tree.loaded){
  parent.nav.tree.selectNode(5546);
 }else{
  setTimeout("syn()",500);
}
  }else{
  setTimeout("syn()",500);
  }}
if(parent!=self){
  setTimeout("syn()",100);
}else{
  parent.location.href = "../index.htm?page=XtremeCommandBars~StateOptions.html";
}
originalOnload = window.onload;
if(originalOnload==null){
window.onload = function(){parent.contentLoaded = true;};
}else{
window.onload = function(){originalOnload();parent.contentLoaded = true;};
}
</script> 


<div id="winchm_template_top">
	<div id="winchm_template_button"><A href="XtremeCommandBars~StateOptions.html" title="Previous topic"><img id="winchm_template_prev" alt="Previous topic" src="template2/btn_prev_n.gif" border="0"></a><A href="XtremeCommandBars~StateOptions_members.html" title="Next topic"><img id="winchm_template_next" alt="Next topic" src="template2/btn_next_n.gif" border="0"></a></div>
	<div id="winchm_template_navigation">Help &gt; 
<A href="welcome_screen.htm">Codejock ActiveX Controls v15.3</A> &gt; <A href="XtremeCommandBars_P.html">Xtreme Command Bars</A> &gt; Objects &gt; <A href="XtremeCommandBars~StateOptions.html">StateOptions Object</A> &gt; </div>
	<div id="winchm_template_title">Overview</div>
</div>
<div id="winchm_template_container">
	<div id="winchm_template_content"><div class=popupbubble id=dxseealsomenu><p id=dxseealsocontent><a href="#Bookmark5547">StateOptions Members</a>
&nbsp;|&nbsp;<a href="#Bookmark4654">CreateStateOptions Method</a>
&nbsp;|&nbsp;<a href="#Bookmark4671">LoadStateFromXMLString Method</a>
&nbsp;|&nbsp;<a href="#Bookmark4677">SaveStateToXMLString Method</a>
&nbsp;|&nbsp;<a href="#Bookmark4655">DeleteAll Method</a>
</p><!--DXMETADATA end --> 
        </div>
        <div id=pagetop>
            <div id=projectnamebanner>
                <table class=projectnametable cellspacing=0>
                    <tbody>
                        <tr>
                            <!--DXMETADATA start type="Literal" condition="childitems:itemtype=seealso" value="<td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td>" --><td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td><!--DXMETADATA end -->
                            <td>
                                <!--DXMETADATA start type="Phrase" Name="Product_Header" -->Xtreme Command Bars ActiveX Control v15.3<!--DXMETADATA end --> 
                            </td>
                            <td align=right>
                                <!--DXMETADATA start type="Variable" name="FeedbackLink" format="" --><!--DXMETADATA end -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id=pagetitlebanner>
                <h1 class=dxh1>
                <!--DXMETADATA start type="PageItemTitle" -->StateOptions Object<!--DXMETADATA end --></h1>
            </div>
        </div>
        <div id=pagebody valign="bottom">
            <!--DXMETADATA start type="IsNew" format="<script>document.all.pagebody.className = 'newTopic'</script>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Description" source="Item" format="<h4 class=dxh4>$$Description$$</h4><p>%%description%%</p>" --><h4 class=dxh4>Description</h4><p>The&nbsp;<STRONG>StateOptions</STRONG>&nbsp;object which is used to store the CommandBar's save settings.&nbsp; The save settings&nbsp;are a set of&nbsp;options that will be used to change how and what&nbsp;will be saved and loaded when loading and saving XML files.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Scrap" name="_MEMBERS_LINK" format="<p>%%scrap%%</p>" --><p>For a list of all members defined in this module, see <a href="#Bookmark5547">StateOptions members</a>.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Diagram" source="item" format="<h4 class=dxh4>$$OBJECT_MODEL$$</h4><p>%%Diagram%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##MODULE_REMARKS" format="<h4 class=dxh4>$$Remarks$$</h4><p>%%comment%%</p>" --><h4 class=dxh4>Remarks</h4><p><P>The <A href="#Bookmark4654">CreateStateOptions</A>&nbsp;method is used to create a set of state options for the Command Bars.</P>
<P>&nbsp;</P>
<P>The <A href="#Bookmark4677">SaveStateToXMLString</A>&nbsp;method uses the <STRONG>StateOptions</STRONG>&nbsp;object to determine how and what to save to the <STRONG>XML</STRONG> string.&nbsp; The <A href="#Bookmark4671">LoadStateFromXMLString</A>&nbsp;method uses the <STRONG>StateOptions</STRONG>&nbsp;object to determine how and what to load from a <STRONG>XML</STRONG> string.</P>
<P>When saving your XML string to a file, be sure to use the <STRONG>.XML</STRONG> file extension.&nbsp; If you open up your <STRONG>.XML</STRONG> file in your favorite web browser the XML string will automatically be formatted into the&nbsp;correct layout.</P></p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="ITEM_LIST_WITH_HEADER" namespace="implemented interface" source="Item" filter="" format="<h4 class=dxh4>$$Interfaces$$</h4>%%filtereditemlist%%" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##MODULE_EXAMPLEINTRO" format="<h4 class=dxh4>$$Example$$</h4><p>%%comment%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="INLINE_EXAMPLE" namespace="Example" source="Item" filter="type=inline" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$Example$$</h4>,format= %%%%filtereditemlist%%" --><h4 class=dxh4>Example</h4><DIV Class=LanguageSpecific Name=Example_VB><p><SPAN class="lang">[Saving and Loading CommandBars Settings in XML Format. (Visual Basic)]</SPAN>&nbsp;This sample illustrates how to use the StateOptions object to specify how and what of the CommandBars state, layout, options, etc will be saved and loaded when the SaveStateToXMLString and LoadStateFromXMLString methods are called to save and load the CommandBars settings.</p><DIV Class=LanguageSpecific Name=Code_VB><TABLE Class="CodeContainerTable" CellPadding="0" CellSpacing="0" Border="0"><TR><TD NOWRAP><CODE Class="VB"><font class='comment'>'***************************************************************************</font><BR/>
<font class='comment'>' Global Variables</font><BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='comment'>'Used to store XML string containing CommandBars settings</font><BR/>
<font class='keyword'>Dim</font> myXMLLayout <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
<font class='comment'>'Used to store the state options that specify how and what will be saved and loaded from the XML sting.</font><BR/>
<font class='keyword'>Dim</font> myStateOptions <font class='keyword'>As</font> StateOptions<BR/>
<BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='comment'>' Form Load</font><BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='keyword'>Private</font> <font class='keyword'>Sub</font> MDIForm_Load()<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'This will create a set of State options that will be used to change how and what will</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'be saved and loaded when using the LoadStateFromXMLString and SaveStateFromXMLString methods</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> myStateOptions = CommandBars.CreateStateOptions<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, no message boxes will be displayed when the CommandBar layout is loaded.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'i.e.  The message box that asks for conformation before the CommandBar layout is reset.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The default is False</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.LoadSilent = <font class='keyword'>False</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, only CommandBars that have been customized will be saved.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The default is True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SaveOnlyCustomized = <font class='keyword'>False</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, the original state of the CommandBars is saved along with the customized state</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'For example, if a button on a toolbar is moved, then both the original and modified states will be saved.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The Default is True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SaveOriginalControls = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'In the CommandBar Designer you can export a XCB file to a XML file and Load it using LoadFromXMLString.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If SerializeDesignerControls is True, then the CommandBars.DesignerControls property will be filled with</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Control items from the CommandBar Designer's controls pane.  This allows you to use LoadFromXMLString instead</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'of the LoadDesignerBars method.  NOTE: DesignerControls are the controls displayed in the customization dialog.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The default is False</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SerializeDesignerControls = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, the controls in the CommandBars will be saved.  If False, no controls will be saved,</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'regardless of the other settings.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The default is True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SerializeControls = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, the images stored in the ImageManager will be saved.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The default is False</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SerializeImages = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, the layout of the CommandBars will be saved.  The Layout includes information such as</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'bar position, location, and size.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The Default is True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SerializeLayout = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'If True, the setting on the Keyboard and Options pages of the Customize dialog will</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'be saved.  This includes shortcut keys and CommandBar options like large icons and full menus.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'The default is False</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStateOptions.SerializeOptions = <font class='keyword'>True</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Sets the commandBars theme to Office 2003</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.VisualTheme = xtpThemeOffice2003<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'This subroutine is called to save a string in XML format that contains all of the CommandBars</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'settings.  The myStateOptions object specifies how and what will be saved to the XML string.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SaveXMLString<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Sets the new commandBars theme to Windows XP</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.VisualTheme =xtpThemeNativeWinXP<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'This subroutine restores the CommandBars Settings with the settings saved when the SaveXMLString</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'subroutine was called.  In this sample, the theme would have been switched back to xtpThemeOffice2003.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LoadXMLString<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='comment'>'Subroutine used to create an string in XML format that contains all of the CommandBars settings and save</font><BR/>
<font class='comment'>'this string to a XML file.</font><BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='keyword'>Public</font> <font class='keyword'>Sub</font> SaveXMLString()<BR/>
<BR/>
<font class='keyword'>Dim</font> FreeF <font class='keyword'>As</font> <font class='keyword'>Integer</font>, sFile <font class='keyword'>As</font> <font class='keyword'>String</font>, sLayout <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
<BR/>
<font class='keyword'>On</font> <font class='keyword'>Error</font> <font class='keyword'>Resume</font> <font color='keyword'>Next</font>:<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Creates a string containing the CommandBars layout, state, and settings.  The state options stored in the myStateOptions</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'object specifies which settings should be saved to the string.  Since multiple strings can be saved</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'to the same file, this string is given the profile name "CommandBarsMDISampleLayout"</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;myXMLLayout = CommandBars.SaveStateToXMLString(<font class='string'>&quot;CommandBarsMDISampleLayout&quot;</font>, myStateOptions)<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'XML string will be saved to the file c:\Layout.xml.  Note that the file extension is .XML.  Opening a file</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'of type XML in a web browser will correctly format the XML sting.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;sFile = <font class='string'>&quot;c:\Layout.xml&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;FreeF = FreeFile<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;Kill sFile<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Open</font> sFile <font class='keyword'>For</font> Binary <font class='keyword'>As</font> #FreeF<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Put</font> #FreeF, , myXMLLayout<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Close</font> #FreeF<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font><BR/>
<BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='comment'>'Subroutine used to open a string in XML format from a XML file and restore the Commandbars</font><BR/>
<font class='comment'>'settings with the settings stored in the XML string.  The state options stored in the</font><BR/>
<font class='comment'>'myStateOptions object will specify how the CommandBars settings will be restored.</font><BR/>
<font class='comment'>'***************************************************************************</font><BR/>
<font class='keyword'>Public</font> <font class='keyword'>Sub</font> LoadXMLString()<BR/>
<BR/>
<font class='keyword'>Dim</font> FreeF <font class='keyword'>As</font> <font class='keyword'>Integer</font>, sFile <font class='keyword'>As</font> <font class='keyword'>String</font>, sLayout <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
<BR/>
<font class='keyword'>On</font> <font class='keyword'>Error</font> <font class='keyword'>Resume</font> <font color='keyword'>Next</font>:<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'XML string will be loaded from the file c:\Layout.xml.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;sFile = <font class='string'>&quot;c:\Layout.xml&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;FreeF = FreeFile<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;myXMLLayout = Space(FileLen(sFile))<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Open</font> sFile <font class='keyword'>For</font> Binary <font class='keyword'>As</font> #FreeF<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Get</font> #FreeF, , myXMLLayout<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Close</font> #FreeF<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>On</font> <font class='keyword'>Error</font> <font class='keyword'>Goto</font> 0<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Load the "CommandBarsMDISampleLayout" profile from the myXMLLayout string.  The state options stored in the</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'myStateOptions object specify how to restore the Command Bars settings.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.LoadStateFromXMLString <font class='string'>&quot;CommandBarsMDISampleLayout&quot;</font>, myXMLLayout, myStateOptions<BR/>
<font class='keyword'>End</font> <font class='keyword'>Sub</font></CODE></TD></TR></TABLE></DIV></DIV>
<!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="seealso" source="Item" filter="" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$See_Also$$</h4><p id=dxseealsocontent>%%filtereditemlist%%</p>" --><h4 class=dxh4>See Also</h4><p id=dxseealsocontent><a href="#Bookmark5547">StateOptions Members</a>
&nbsp;|&nbsp;<a href="#Bookmark4654">CreateStateOptions Method</a>
&nbsp;|&nbsp;<a href="#Bookmark4671">LoadStateFromXMLString Method</a>
&nbsp;|&nbsp;<a href="#Bookmark4677">SaveStateToXMLString Method</a>
&nbsp;|&nbsp;<a href="#Bookmark4655">DeleteAll Method</a>
</p><!--DXMETADATA end --><!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="example" source="Item" filter="type=linked" NoHeader="True" NoFooter="True" format="><!--DXMETADATA end --><!--DXMETADATA start type="Variable" name="CopyrightNotice" format="><!--DXMETADATA end --></div></div>	
	<div id="winchm_template_footer">Copyright &copy; 2018. All rights 
reserved. (To change the copyright info, just edit it in template.)</div>
</div>

</body>
</html>

